package Clothing.controller.agreement;

import javax.annotation.Resource;

import org.springframework.http.HttpRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import Clothing.bean.request.agreement.GetAgreementRequest;
import Clothing.bean.respose.getAgreementList.GetAgreementListResponse;
import Clothing.service.agreement.AgreementService;
import Clothing.util.ResultModel;

@Controller
@RequestMapping(value = "/Agreement")
public class AgreementController {

    @Resource
    private AgreementService agreementService;
    
    @RequestMapping(value = "/getAgreementList" ,method = RequestMethod.POST)
    @ResponseBody
    public ResultModel getAgreementList(@RequestBody GetAgreementRequest request){
        ResultModel resultModel = new ResultModel();
        GetAgreementListResponse response = new GetAgreementListResponse();
        
        int result = agreementService.getAgreementList(request,response);
        switch (result) {
            case 0:
                response.setSuccess("0");
                break;
            case 1:
                response.setSuccess("1");
                break;
            default:
                break;
        }
        resultModel.setData(response);
        return resultModel;
    }
}
